<?php

use App\Http\Controllers\Common\AnalyzeXlsxController;
use App\Http\Controllers\Common\EkbController;
use App\Http\Controllers\Common\LzController;
use App\Http\Controllers\Common\CommonController;
use App\Http\Controllers\Cruise\Archive\ArchiveController;
use App\Http\Controllers\Cruise\CruiseController;
use App\Http\Controllers\Cruise\Feishu\CruiseCheckAlbumController;
use App\Http\Controllers\Cruise\Feishu\CruiseCheckRectifyAppletController;
use App\Http\Controllers\Cruise\FeishuMini\CheckDetailController;
use App\Http\Controllers\Cruise\FeishuMini\CheckTaskController;
use App\Http\Controllers\Cruise\Merchant\CruiseCheckController;
use App\Http\Controllers\Cruise\Web\CruiseCheckAgainstController;
use App\Http\Controllers\Cruise\Web\CruiseCheckCompanyController;
use App\Http\Controllers\Cruise\Web\CruiseCheckErrorsController;
use App\Http\Controllers\Cruise\Web\CruiseCheckSelfTaskController;
use App\Http\Controllers\Cruise\Web\CruiseTourController;
use App\Http\Controllers\Kms\App\Album\AlbumResourceController;
use App\Http\Controllers\OpenShop\Feishu\UserBaseInfoController;
use App\Http\Middleware\OpenShop\MerchantAppAuth;
use App\Http\Middleware\OpenShop\UserPermissionAuth;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Cruise\Web\CruiseProjectController;
use App\Http\Controllers\Cruise\Web\CruiseCategoryController;
use App\Http\Controllers\Cruise\Web\CruiseTemplateController;
use App\Http\Middleware\OpenShop\AppletAuth;
use App\Http\Middleware\OpenShop\FeishuWebAuth;
use App\Http\Controllers\Cruise\Web\CruiseCheckSpecialController;
use App\Http\Controllers\Cruise\Web\ShopController;
use App\Http\Controllers\Cruise\Web\CruiseCheckReportController;
use App\Http\Controllers\Cruise\FeishuMini\CheckInputController;
use App\Http\Middleware\Common\LockBefore;
use App\Http\Middleware\Common\LockAfter;
use App\Http\Controllers\Cruise\Merchant\CruiseCheckRectifyController;

Route::get('test', function () {
    return 'hello world';
});

Route::prefix('common')->group(function () {
    Route::get('riskProblem', [\App\Http\Controllers\Cruise\Common\CruiseController::class, 'riskProblem']);
});


$appletRoute = function () {
    /**
     * 小程序
     */
    Route::prefix('cruiseMission')->group(function () {
        Route::get('lists', [CruiseController::class, 'lists']); // 任务列表
        Route::get('listsCount', [CruiseController::class, 'listsCount']); // 任务列表顶部数字
        Route::get('info/{id}', [CruiseController::class, 'info'])
             ->where('id', '[0-9]+');
        Route::get('tab', [CruiseController::class, 'tabPermission']); // 稽核小程序tab权限

        // 任务可转交的人员列表
        Route::get('transferUsers', [CruiseController::class, 'transferUsers']);

        // 任务转交
        Route::post('transfer', [CruiseController::class, 'transfer'])->middleware([
            LockBefore::class . ":" . LockBefore::LOCK_TYPE_WEB_USER_ID . ':5',
            LockAfter::class . ':' . LockBefore::LOCK_TYPE_WEB_USER_ID
        ]);

        // 巡店表单
        Route::get('inputs/info', [CruiseController::class, 'inputsInfo']);
        Route::post('inputs/update', [CruiseController::class, 'inputsUpdate']);
        Route::post('inputs/submit', [CruiseController::class, 'inputsSubmit']);
        Route::post('inputs/audit', [CruiseController::class, 'audit']);
    });

    Route::get('getBusinessData', [CruiseController::class, 'getBusinessData'])->withoutMiddleware([
        AppletAuth::class,
        UserPermissionAuth::class . ':' . UserPermissionAuth::MODULE_CRUISE
    ]);

    Route::prefix('shop')->group(function () {
        Route::get('lists', [CruiseController::class, 'shopList']);
        Route::get('detail/{shopId}', [CruiseController::class, 'shopDetail'])
             ->where('shopId', '[0-9]+');

        //开业状态
        Route::get('startBusiness/status', [CruiseController::class, 'startBusinessStatus']);

        //订货指标
        Route::get('order/target', [CruiseController::class, 'shopOrderTarget']);
    });

    /**
     * 加盟商档案
     */
    Route::prefix('archive')->group(function () {
        //编辑加盟商档案
        Route::post('franchisee/update/{id}', [ArchiveController::class, 'franchiseeUpdate'])
             ->where('id', '[0-9]+');
        //获得加盟商档案
        Route::get('franchisee/detail/{shopId}', [ArchiveController::class, 'franchiseeDetail'])
             ->where('shopId', '[0-9]+');
    });


    /**
     * 稽核
     */
    Route::prefix('check')->group(function () {

        //作废任务
        Route::post('order/cancel/{id}', [CheckTaskController::class, 'cancelOrder'])->where('id', '[0-9]+');

        // 稽核表单
        Route::prefix('inputs')->group(function () {
            Route::get('info/{id}', [CheckInputController::class, 'info']);
            Route::post('update/{id}', [CheckInputController::class, 'update'])->middleware([
                LockBefore::class . ":" . LockBefore::LOCK_TYPE_RESTFUL_ID . ':5',
                LockAfter::class . ':' . LockBefore::LOCK_TYPE_RESTFUL_ID
            ]);
            Route::post('submit/{id}', [CheckInputController::class, 'submit'])->middleware([
                LockBefore::class . ":" . LockBefore::LOCK_TYPE_RESTFUL_ID . ':5',
                LockAfter::class . ':' . LockBefore::LOCK_TYPE_RESTFUL_ID
            ]);
            Route::post('audit/{id}', [CheckInputController::class, 'audit'])->middleware([
                LockBefore::class . ":" . LockBefore::LOCK_TYPE_RESTFUL_ID . ':5',
                LockAfter::class . ':' . LockBefore::LOCK_TYPE_RESTFUL_ID
            ]);
        });

        //领取任务 - 专项巡检
        Route::post('/task/achieve/{id}',
            [\App\Http\Controllers\Cruise\Feishu\CruiseController::class, 'addSpecialTaskByShopId'])
             ->where('id', '[0-9]+');

        //去巡检 - 常规巡检
        Route::post('/task/receive/{shopId}',
            [\App\Http\Controllers\Cruise\Feishu\CruiseController::class, 'addSameTaskByShopId'])
             ->where('shopId', '[0-9]+');

        //去巡检 - 工厂巡检
        Route::post('/task/receiveCompany', [\App\Http\Controllers\Cruise\Feishu\CruiseController::class, 'addCompanyTaskBySelfCompany'])
             ->where('id', '[0-9]+');

        //巡店报告
        Route::prefix('report')->group(function () {
            Route::get('list', [CheckDetailController::class, 'reportList']);
            Route::get('count', [CheckDetailController::class, 'reportCount']);
            Route::get('detail/{id}', [CheckDetailController::class, 'detail']);
        });


        //更新稽核人员照片
        Route::post('/updateCheckUserPhone', [CruiseController::class, 'updateCheckUserPhone']);
        //获得稽核人员基本信息
        Route::get('/getCheckUserInfo', [CruiseController::class, 'getCheckUserInfo']);


        //稽核相册
        Route::prefix('album')->group(function () {
            Route::post('upload', [CruiseCheckAlbumController::class, 'uploadAlbum']);
            Route::get('list', [CruiseCheckAlbumController::class, 'list']);
            Route::get('kmsResource', [AlbumResourceController::class, 'resourceList']);
        });

        // 任务列表
        Route::prefix("supplierTask")->group(function () {
            Route::get('groupPreview', [CruiseCheckSelfTaskController::class, 'supplierTaskGroupPreview']);
            Route::get('preview/{cruiseCheckCompanyId}', [CruiseCheckSelfTaskController::class, 'supplierTaskPreview'])
                 ->where('cruiseCheckCompanyId', '[0-9]+');
            Route::put('todayNotProduce', [CruiseCheckSelfTaskController::class, 'todayNotProduce']);

            Route::get('detail', [CruiseCheckSelfTaskController::class, 'supplierTaskDetail']);
        });

        // 整改单
        Route::prefix('rectify')->group(function () {
            Route::get('listsCount', [CruiseCheckRectifyAppletController::class, 'listsCount']);                      // 整改单列表顶部统计
            Route::get('lists', [CruiseCheckRectifyAppletController::class, 'lists']);                          // 整改单列表
            Route::get('detail/{id}', [CruiseCheckRectifyAppletController::class, 'detail'])->where('id', '[0-9]+');  // 整改单详情

            // 整改单提交整改内容
            Route::post('submit/{id}', [CruiseCheckRectifyAppletController::class, 'submit'])->where('id', '[0-9]+')->middleware([
                LockBefore::class . ":" . LockBefore::LOCK_TYPE_WEB_USER_ID . ':5',
                LockAfter::class . ':' . LockBefore::LOCK_TYPE_WEB_USER_ID
            ]);
            Route::get('replyDetail/{id}', [CruiseCheckRectifyAppletController::class, 'replyDetail'])
                 ->where('id', '[0-9]+'); // 整改内容详情
        });

    });

    /**
     * 门店档案
     */
    Route::prefix('shopArchive')->group(function () {
        //获得加盟商档案
        Route::get('detail/{shopId}', [ArchiveController::class, 'shopArchiveDetail'])
             ->where('shopId', '[0-9]+');
        //编辑加盟商档案
        Route::post('update/{shopId}', [ArchiveController::class, 'shopArchiveUpdate'])
             ->where('shopId', '[0-9]+');
        Route::post("businessLicense", [UserBaseInfoController::class, "businessLicenseRecognize"]);//营业执照识别
        Route::post("foodBusinessLicense", [CommonController::class, "foodProduceLicenseRecognize"]);//食品经营许可证识别
    });

    //易快报
    Route::prefix("ekb")->group(function () {
        //支行列表
        Route::get('branchBank', [EkbController::class, 'branchBank']);
    });

    //联卓 - 银行卡号查询银行信息
    Route::prefix("lz")->group(function () {
        //支行列表
        Route::get('queryBankAps', [LzController::class, 'queryBankAps']);
    });

};

Route::middleware([AppletAuth::class, UserPermissionAuth::class . ':' . UserPermissionAuth::MODULE_CRUISE])
     ->prefix('feishuMini')->group($appletRoute);

Route::middleware([\App\Http\Middleware\H5Authenticate::class])
     ->prefix('h5')->group($appletRoute);


/**
 * web
 */
Route::middleware([FeishuWebAuth::class, UserPermissionAuth::class . ':' . UserPermissionAuth::MODULE_CRUISE])
     ->prefix('web')->group(function () {

        /**
         * 分类
         */
        Route::prefix('category')->group(function () {
            Route::get('lists', [CruiseCategoryController::class, 'lists']);
            Route::post('update/{id}', [CruiseCategoryController::class, 'update'])
                 ->where('id', '[0-9]+');
            Route::post('add', [CruiseCategoryController::class, 'add']);
            Route::post('delete/{id}', [CruiseCategoryController::class, 'delete'])
                 ->where('id', '[0-9]+');
        });

        /**
         * 项目
         */
        Route::prefix('project')->group(function () {
            Route::post('add', [CruiseProjectController::class, 'add']);
            Route::post('edit/{id}', [CruiseProjectController::class, 'edit']);
            Route::post('offline/{id}', [CruiseProjectController::class, 'offline']);
            Route::post('delete/{id}', [CruiseProjectController::class, 'delete']);
            Route::get('lists', [CruiseProjectController::class, 'lists']);
            Route::get('detail/{id}', [CruiseProjectController::class, 'detail']);
            Route::get('meanTypes', [CruiseProjectController::class, 'meanTypes']);
        });

        /**
         * 模板
         */
        Route::prefix('template')->group(function () {
            Route::get('selfCheckList', [CruiseTemplateController::class, 'selfCheckTemplateList']);
            Route::get('typeLists', [CruiseTemplateController::class, 'typeLists']);
            Route::get('lists', [CruiseTemplateController::class, 'lists']);
            Route::get('detail/{id}', [CruiseTemplateController::class, 'detail']);
            Route::post('add', [CruiseTemplateController::class, 'add']);
            Route::post('edit/{id}', [CruiseTemplateController::class, 'edit']);
            Route::post('setStatus/{id}', [CruiseTemplateController::class, 'offline']);
        });

        /**
         * 任务
         */
        Route::prefix('cruiseMission')->group(function () {
            Route::get('inputs/info', [CruiseController::class, 'inputsInfoWeb']);
        });

        /**
         * 专项巡检任务列表
         */
        Route::prefix('checkSpecial')->group(function () {
            Route::get('lists', [CruiseCheckSpecialController::class, 'lists']);
            Route::get('detail/{id}', [CruiseCheckSpecialController::class, 'detail']);
            Route::get('completion/{id}', [CruiseCheckSpecialController::class, 'completion']); // 完成情况
            Route::post('add', [CruiseCheckSpecialController::class, 'add']);
            Route::post('edit/{id}', [CruiseCheckSpecialController::class, 'edit']);
            Route::post('push/{id}', [CruiseCheckSpecialController::class, 'push'])->middleware([
                LockBefore::class . ":" . LockBefore::LOCK_TYPE_WEB_USER_ID . ':5',
                LockAfter::class . ':' . LockBefore::LOCK_TYPE_WEB_USER_ID
            ]);
            Route::post('offline/{id}', [CruiseCheckSpecialController::class, 'offline']);

            Route::get('addSelects', [CruiseCheckSpecialController::class, 'addSelects']);
        });

        /**
         * 巡检报告 = 门店稽核 + 门店自检
         */
        Route::prefix('checkReport')->group(function () {
            Route::get('lists', [CruiseCheckReportController::class, 'lists']);
            Route::get('detail/{id}', [CruiseCheckReportController::class, 'detail'])->where('id', '[0-9]+');
        });

        /**
         * 门店
         */
        Route::prefix('shop')->group(function () {
            Route::get('lists', [ShopController::class, 'lists']); // 门店筛选
        });

        /**
         * 巡检业务 = 门店稽核 + 门店自检
         */
        Route::prefix('checkBusiness')->group(function () {
            //任务列表
            Route::get('cruiseList', [CruiseController::class, 'cruiseList']);
            //任务详情
            Route::get('cruiseDetail/{id}', [CruiseController::class, 'cruiseDetail'])->where('id', '[0-9]+');

            // 可移交的用户列表
            Route::get('transferUsers', [CruiseController::class, 'transferUsers']);

            // 任务转交
            Route::post('transfer', [CruiseController::class, 'transfer'])->middleware([
                LockBefore::class . ":" . LockBefore::LOCK_TYPE_WEB_USER_ID . ':5',
                LockAfter::class . ':' . LockBefore::LOCK_TYPE_WEB_USER_ID
            ]);

            //督导打分
            Route::post('superviseGrade/{id}', [CruiseController::class, 'superviseGrade'])->where('id', '[0-9]+');
            //督导驳回
            Route::post('superviseReject/{id}', [CruiseController::class, 'superviseReject'])->where('id', '[0-9]+');

            //开具违约函
            Route::post('drawUpAgainst/{id}', [CruiseCheckAgainstController::class, 'drawUpAgainst'])
                 ->where('id', '[0-9]+');
        });

        // 整改单
        Route::prefix('rectify')->group(function () {
            Route::get('lists',
                [\App\Http\Controllers\Cruise\Web\CruiseCheckRectifyController::class, 'lists']); // 整改单列表
            Route::get('detail/{id}', [CruiseCheckRectifyController::class, 'detail'])->where('id', '[0-9]+'); // 整改单详情
            Route::get('replyDetail/{id}', [CruiseCheckRectifyController::class, 'replyDetail'])
                 ->where('id', '[0-9]+'); // 整改内容详情
            Route::post('audit/{id}', [\App\Http\Controllers\Cruise\Web\CruiseCheckRectifyController::class, 'audit'])
                 ->where('id', '[0-9]+'); // 整改内容详情
            Route::post('batchClose', [\App\Http\Controllers\Cruise\Web\CruiseCheckRectifyController::class, 'batchClose']); // 待整改批量关闭

            // 巡检人列表
            Route::get('dealUidList', [CruiseCheckRectifyController::class, 'dealUidList']);
        });

        /**
         * 异常报备单
         */
        Route::prefix('checkErrors')->group(function () {
            Route::get('lists', [CruiseCheckErrorsController::class, 'lists']);
            Route::get('detail/{id}', [CruiseCheckErrorsController::class, 'detail']);
            Route::post('edit/{id}', [CruiseCheckErrorsController::class, 'edit']);
        });

        /**
         * 违约函
         */
        Route::prefix('checkAgainst')->group(function () {
            Route::get('lists', [CruiseCheckAgainstController::class, 'lists']);
            Route::get('detail/{id}', [CruiseCheckAgainstController::class, 'detail']);
            Route::post('add', [CruiseCheckAgainstController::class, 'add']);
            Route::put('edit/{id}', [CruiseCheckAgainstController::class, 'edit']);
            Route::put('cancel/{id}', [CruiseCheckAgainstController::class, 'cancel']);
            Route::get('shopVersion/{shopId}', [CruiseCheckAgainstController::class, 'shopVersion']);
            Route::get('shopVersionPreview', [CruiseCheckAgainstController::class, 'shopVersionPreview']);
        });

        /**
         * 业务总览
         */
        Route::prefix('businessOverview')->group(function () {
            Route::get('index', [\App\Http\Controllers\Cruise\Web\CruiseCheckOverviewController::class, 'index']);
        });


        // 自检任务 = 工厂稽核 + 门店自检
        Route::prefix('selfTask')->group(function () {
            Route::post('insert', [CruiseCheckSelfTaskController::class, 'insert']);
            Route::put('update', [CruiseCheckSelfTaskController::class, 'update']);
            Route::get('detail', [CruiseCheckSelfTaskController::class, 'detail']);
            Route::post('status', [CruiseCheckSelfTaskController::class, 'status']);
            Route::get('del', [CruiseCheckSelfTaskController::class, 'del']);
            Route::get('index', [CruiseCheckSelfTaskController::class, 'index']);
            Route::get('finishCondition', [CruiseCheckSelfTaskController::class, 'finishCondition']);
        });


    /**
     * 供应商
     */
    Route::prefix('company')->group(function () {
        //选择供应商
        Route::get('frontCompany', [CruiseCheckCompanyController::class, 'frontCompany']);
        //选择用户信息
        Route::get('frontUserInfo', [CruiseCheckCompanyController::class, 'frontUserInfo']);
        //添加供应商配置
        Route::post('save', [CruiseCheckCompanyController::class, 'save']);
        //供应商配置列表
        Route::get('list', [CruiseCheckCompanyController::class, 'list']);
        //删除某个供应商
        Route::post('delete/{id}', [CruiseCheckCompanyController::class, 'delete'])->where('id', '[0-9]+');
        //启用或者停用
        Route::post('able/{id}', [CruiseCheckCompanyController::class, 'able'])->where('id', '[0-9]+');
        //查看详情
        Route::get('detail/{id}', [CruiseCheckCompanyController::class, 'detail'])->where('id', '[0-9]+');

        //供应商查询接口
        Route::get('selectCompany', [CruiseCheckCompanyController::class, 'selectCompany']);

        // 获得员工列表
        Route::get('staffList', [CruiseCheckCompanyController::class, 'staffList']);
        // 获得品控服务商
        Route::get('qualityControlCompanyList', [CruiseCheckCompanyController::class, 'qualityControlCompanyList']);
        // 修改、添加员工信息
        Route::post('saveStaffInfo', [CruiseCheckCompanyController::class, 'saveStaffInfo']);
        // 修改员工状态
        Route::post('updateStaffStatus', [CruiseCheckCompanyController::class, 'updateStaffStatus']);
        // 导入员工列表
        Route::post('importSupplierCruiseStaff', [AnalyzeXlsxController::class, 'analyzeXlsx']);

        // 供应商审核人配置
        Route::get('getAuditor', [CruiseCheckCompanyController::class, 'getAuditor']);
        Route::post('setAuditor', [CruiseCheckCompanyController::class, 'setAuditor']);
    });


        /**
         * 云巡店
         */
        Route::prefix('tour')->group(
            function () {

                // 云巡店表单
                Route::get('list', [CruiseTourController::class, 'list']);//巡检记录列表
                Route::get('info/{id}', [CruiseTourController::class, 'info'])->where('id', '[0-9]+');//巡检记录详情

                Route::post('inputs/add', [CruiseTourController::class, 'inputsAdd']);//巡检任务表单新增记录
                Route::get('inputs/info', [CruiseTourController::class, 'inputsInfo']);//巡检任务表单记录详情
                Route::post('inputs/update', [CruiseTourController::class, 'inputsUpdate']);//巡检任务表单记录修改
                Route::post('inputs/submit', [CruiseTourController::class, 'inputsSubmit']);//巡检任务表单记录提交
                //作废任务
                Route::post('inputs/cancel/{id}', [CruiseTourController::class, 'inputsCancelOrder'])->where('id', '[0-9]+');

                Route::post('/uploadResources', [CruiseTourController::class, 'uploadResources']);//截图、视频资源上传
                Route::get('/resourcesList', [CruiseTourController::class, 'resourcesList']);//截图、视频资源库列表
                Route::get('/getResources/{id}', [CruiseTourController::class, 'getResources'])->where('id', '[0-9]+');//截图、视频资源库详情
                Route::delete('/delResources/{id}', [CruiseTourController::class, 'delResources'])->where('id', '[0-9]+');//截图、视频资源库删除
            }
        );

        // 消杀服务相关
        Route::prefix('disinfect')->group(function () {
            // 获取文件内容
            Route::post('analyzeXlsx', [\App\Http\Controllers\Cruise\Web\CruiseDisinfectController::class, 'analyzeXlsx']);
            // 任务导入
            Route::post('importTask', [\App\Http\Controllers\Cruise\Web\CruiseDisinfectController::class, 'importTask']);

        });

        /**
         * 门店证件备案
         */
        Route::prefix('shopLicense')->group(function () {
            Route::get('list', [\App\Http\Controllers\Cruise\Web\CruiseShopLicenseController::class, 'list']); //
            Route::get('info', [\App\Http\Controllers\Cruise\Web\CruiseShopLicenseController::class, 'info']); //
            Route::post('update', [\App\Http\Controllers\Cruise\Web\CruiseShopLicenseController::class, 'update']); //
            Route::post('submit', [\App\Http\Controllers\Cruise\Web\CruiseShopLicenseController::class, 'submit']); //
            Route::get('recordLog', [\App\Http\Controllers\Cruise\Web\CruiseShopLicenseController::class, 'recordLog']);
        });
    });

/**
 * Merchant
 */
Route::prefix('merchant')->middleware(MerchantAppAuth::class)->group(function () {
    // 二级模板列表
    Route::get('systemTemplate', [CruiseCheckController::class, 'systemTemplate']);
    //获得扫码信息
    Route::post('getQrCodeInfo', [CruiseCheckController::class, 'getQrCodeInfo']);

    Route::prefix('input')->group(function () {
        Route::get('list', [CruiseCheckController::class, 'list']); // 门店巡检报告
        Route::get('detail/{id}', [CruiseCheckController::class, 'detail'])->where('id', '[0-9]+'); // 门店巡检详情
    });

    // 整改单
    Route::prefix('rectify')->group(function () {
        Route::get('listsCount', [CruiseCheckRectifyController::class, 'listsCount']); // 整改单列表顶部统计
        Route::get('lists', [CruiseCheckRectifyController::class, 'lists']); // 整改单列表
        Route::get('detail/{id}', [CruiseCheckRectifyController::class, 'detail'])->where('id', '[0-9]+'); // 整改单详情
        Route::post('submit/{id}', [CruiseCheckRectifyController::class, 'submit'])->where('id', '[0-9]+')->middleware([
            LockBefore::class . ":" . LockBefore::LOCK_TYPE_RESTFUL_ID . ':5',
            LockAfter::class . ':' . LockBefore::LOCK_TYPE_RESTFUL_ID
        ]); // 整改单提交整改

        Route::get('replyDetail/{id}', [CruiseCheckRectifyController::class, 'replyDetail'])
             ->where('id', '[0-9]+'); // 整改内容详情
    });

    // 自检任务列表
    Route::prefix("shopSelfCheck")->group(function () {
        // 自检列表
        Route::get('list', [\App\Http\Controllers\Cruise\Merchant\CruiseCheckSelfTaskController::class, 'shopSelfCheckTaskList']);
        // 自检详情列表 - 按日期
        Route::get('allDailyDetail/{id}', [\App\Http\Controllers\Cruise\Merchant\CruiseCheckSelfTaskController::class, 'shopSelfCheckTaskDailyDetail'])
             ->where('id', '[0-9]+');
        // 自检任务作废（今日不生产）
        Route::put('invalidSingleTask/{checkSelfDetailId}', [\App\Http\Controllers\Cruise\Merchant\CruiseCheckSelfTaskController::class, 'invalidSingleTask']);
        // 自检列表
        Route::get('listV2', [\App\Http\Controllers\Cruise\Merchant\CruiseCheckSelfTaskController::class, 'shopSelfCheckTaskListV2']);

        // 自检报告
        Route::prefix('report')->group(function () {
            // 自检记录
            Route::get('list', [CruiseCheckController::class, 'getSelfCheckReportList']);
            Route::get('listV2', [CruiseCheckController::class, 'getSelfCheckReportListV2']);
            Route::get('taskNameList', [CruiseCheckController::class, 'taskNameList']);

            // 表单详情（提交前） - cruiseCheckId
            Route::get('detail/{id}', [\App\Http\Controllers\Cruise\Web\CruiseCheckDetailController::class, 'detail']);

            // 报告详情（提交后） - cruiseOrderId
            Route::get('afterSubmitDetail/{id}', [CruiseCheckController::class, 'afterSubmitDetail']);
        });

        // 填写表单相关
        Route::prefix('inputs')->group(function () {
            Route::get('info/{id}', [CheckInputController::class, 'info']);
            Route::post('update/{id}', [CheckInputController::class, 'update'])->middleware([
                LockBefore::class . ":" . LockBefore::LOCK_TYPE_RESTFUL_ID . ':5',
                LockAfter::class . ':' . LockBefore::LOCK_TYPE_RESTFUL_ID
            ]);
            Route::post('submit/{id}', [CheckInputController::class, 'submit'])->middleware([
                LockBefore::class . ":" . LockBefore::LOCK_TYPE_RESTFUL_ID . ':5',
                LockAfter::class . ':' . LockBefore::LOCK_TYPE_RESTFUL_ID
            ]);
        });
    });

    Route::prefix('pay')->group(function () {
        Route::get('detail', [\App\Http\Controllers\Pay\Merchant\PayController::class, 'againstDetail']);
    });

    /**
     * 违约函
     */
    Route::prefix('checkAgainst')->group(function () {
        Route::get('shopVersionPreview/{id}',
            [\App\Http\Controllers\Cruise\Merchant\CruiseCheckAgainstController::class, 'shopVersionPreview'])
             ->where('id', '[0-9]+');

        //违约函确认
        Route::post('confirm/{id}',
            [\App\Http\Controllers\Cruise\Merchant\CruiseCheckAgainstController::class, 'confirm'])
             ->where('id', '[0-9]+')
             ->middleware([
                LockBefore::class . ":" . LockBefore::LOCK_TYPE_RESTFUL_ID . ':5',
                LockAfter::class . ':' . LockBefore::LOCK_TYPE_RESTFUL_ID
            ]);
    });

    /**
     * 网商账号注册
     */
    Route::prefix('mybank')->group(function () {

        // 表单操作
        Route::get('inputs/info', [\App\Http\Controllers\Cruise\Merchant\MybankController::class, 'inputsInfo'])->middleware([
            LockBefore::class . ":" . LockBefore::LOCK_TYPE_MERCHANT_USER_ID . ':5',
            LockAfter::class . ':' . LockBefore::LOCK_TYPE_MERCHANT_USER_ID
        ]);
        Route::post('inputs/update', [\App\Http\Controllers\Cruise\Merchant\MybankController::class, 'inputsUpdate']);
        Route::post('inputs/submit', [\App\Http\Controllers\Cruise\Merchant\MybankController::class, 'inputsSubmit'])->middleware([
            LockBefore::class . ":" . LockBefore::LOCK_TYPE_MERCHANT_USER_ID . ':15',
            LockAfter::class . ':' . LockBefore::LOCK_TYPE_MERCHANT_USER_ID
        ]);
    });

    Route::prefix('shopSelfCheckNotifyConfig')->group(function () {
        Route::get('info', [\App\Http\Controllers\Cruise\Merchant\ShopCheckNotifyConfigController::class, 'info']); //
        Route::post('set', [\App\Http\Controllers\Cruise\Merchant\ShopCheckNotifyConfigController::class, 'set']); //
    });

    //稽核相册
    Route::prefix('album')->group(function () {
        Route::post('upload', [CruiseCheckAlbumController::class, 'uploadAlbum']);
    });

    //门店证照
    Route::prefix('shopLicense')->group(function () {
        Route::get('info', [\App\Http\Controllers\Cruise\Merchant\CruiseShopLicenseController::class, 'info']);
        Route::post('update', [\App\Http\Controllers\Cruise\Merchant\CruiseShopLicenseController::class, 'update']);
    });


});

